
#ifndef _MAINWINDOW_H_
#define _MAINWINDOW_H_

#include <BLineEdit>
#include <BTextEdit>
#include <BLabel>
#include <BButton>
#include <BScrollArea>
#include <BScrollWidget>
#include <BListWidget>
#include <BListItem>
#include <BProgressBar>
#include <BComboBox>
#include <BTableWidget>
#include <BTableItem>
#include <BScrollWidget>
#include <BScrollBar>
#include <BTreeWidget>
#include <BHtmlWidget>
#include <BStyle>
#include <BGridLayout>
#include <BHBoxLayout>
#include <BVBoxLayout>
#include <BGroupBox>
#include <BXmlNode>
#include <BSonNode>
#include <BMenu>
#include <BMainWindow>

#include "StyleEdit.h"

using namespace BWE;

class MainWindow : public BMainWindow
{
public:
	MainWindow();
	~MainWindow();

protected:
	BTreeItem* createTreeItem(BXmlNode* node);
	BTreeItem* createTreeItem(BSonNode* node);
	bool assignIcon(BTreeItem* item);

protected:
	void slotColorButtonClicked(BObject* object);
	void slotSpinBoxEditFinished(BObject* object, const BValue& value);
	void slotRealSpinBoxEditFinished(BObject* object, const BValue& value);
	void slotFloatSpinBoxEditFinished(BObject* object, const BValue& value);
	void slotDoubleSpinBoxEditFinished(BObject* object, const BValue& value);
	void slotFileButtonClicked(BObject* object);
	void slotMessageButtonClicked();
	void slotFilePathRightClicked();
	void slotLoadButtonClicked();

	void slotItemDoubleClicked(BObject* object, const BValue& value);
	void slotItemTextEdited(BObject* object, const BValue& value);
	void slotItemTextEditFocused(BObject* object, const BValue& value);
	void slotPolicyButtonClicked(BObject* object, const BValue& value);
	void slotPolicyMenuTrigger(BObject* object, const BValue& value);

	void slotSheetFileNameEdited();
	void slotChooseSheetFile();
	void slotSaveSheetButtonClicked();
	void slotStyleSheetEdited(BObject* object, const BValue& value);

private:
	BComboBox*		_filePathComboBox;
	BButton*		_loadFileButton;
	StyleEdit*		_styleSheetEdit;
	BLineEdit*		_sheetfileNameEdit;
	BButton*		_saveSheetButton;
	BHtmlWidget*	_htmlWidget;
	BTreeWidget*	_treeWidget;
	BTextEdit*		_textEdit;
};

#endif